package com.ymh.spring.annotation;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.ymh.spring.annotation.config.ManConfig;
import com.ymh.spring.annotation.service.ManInterface;

public class JavaConfigApplication {
	
	public static void main(String[] args) {
		/**
		 * 从一个或多个基于（Java的配置类）中加载Spring应用上下文
		 */
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ManConfig.class);
		
		ManInterface man = (ManInterface) context.getBean("chineseImpl");
		
		System.out.println(man.sayHello());
		
		context.close();
	}

	
}
